-<template>
  <view>
    <view class="">
      <view class="manage-btn" @click="manage">批量管理</view>
      <view style="height: 100rpx;"></view>
      <u-checkbox-group @change="checkboxGroupChange" style="display: block;">
        <view class="list" v-for="(item,index) in Data" :key="index">
          <view class="list-item">
            <view class="list-item__container container--right">
              <view class="list-item__radio" v-if="radioisShow">
                <u-checkbox
                  :name="item.Id" 
                  v-model="item.checked"
                  active-color="#fed500" 
                  shape="circle"
                  size="30"
                  style="display: block !important;">
                 </u-checkbox>
              </view>
              <view class="list-item__header" @click="OrderInfo">
                <view class="list-item__icon">
                  <view class="list-item__icon-img">
                    <image src="/static/logo.png" mode="scaleToFill" class="img"></image>
                  </view>
                </view>
              </view>
              <view class="list-item__content" @click="OrderInfo">
                <text class="list-item__content-title u-line-1">活动商品软件服务\信息技术开发</text>
                <text class="list-item__content-note">已选择:规格1/规格3</text>
                <text class="list-item__content-note">数量：2</text>
                <view class="list-item__content-price">
                  <text class="list-item__container-t">价格：98.00*2</text>
                  <text class="list-item__container-t right">总价：<text class="price">196.00</text></text>
                </view>
              </view>
              <view class="list-item__extra">
                <view class="list-item__extra-text">
                  <u-icon name="arrow-right" color="#999" size="28"></u-icon>
                </view>
              </view>
            </view>
          </view>
        </view>
      </u-checkbox-group>
    </view>
    <view style="height: 350rpx;"></view>
    <view class="total-price select u-flex" v-show="radioisShow">
      <view class="u-flex-1">
        <text style="font-size: 24rpx;">已选:</text>
        <text class="u-m-l-32" style="font-size: 32rpx;">{{checklength}}</text>
      </view>
      <view @click="deleteShow = true">
        <text class="iconfont icon-shanchu delete-btn_icon"></text>
      </view>
    </view>
    <view class="total-price" :class="radioisShow ? '':'box-shadow'">
      <text style="font-size: 24rpx;">总价:</text>
      <text class="u-m-l-32" style="font-size: 32rpx;">196.00</text>
    </view>
    <view class="s-btn s-btn--primary s-size-default" @click="confirmPayShow = true">确认支付</view>
    <u-modal 
      v-model="deleteShow"
      content="确实删除选择的商品？"
      :show-cancel-button="true"
      confirm-text="是"
      cancel-text="否"
      confirm-color="#fed500"
      @confirm="confirmDelete"
    ></u-modal>
    <u-popup 
      v-model="confirmPayShow"
      mode="bottom" 
      height="808rpx"
      :safe-area-inset-bottom="true">
      <view class="content">
        <view class="addressee">
          <view class="list" style="margin-top: 0rpx;">
            <view class="list-item">
              <view class="list-item__container container--right">
                <view class="list-item__content">
                  <view class="list-item__content-title u-line-1 addressee-title">收件信息：</view>
                  <view class="addressee-note">
                    <text class="address">广东省</text>
                    <text class="address">汕头市</text>
                    <text class="address">龙湖区</text>
                    <text class="address">珠池街道</text>
                  </view>
                  <view class="addressee-note">生生花园几栋几零几</view>
                  <view class="addressee-note">
                    <text class="address">郑</text>
                    <text class="address">13566677789</text>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </view>
        <u-cell-group>
          <u-cell-item title="订单运费" :title-style="titleStyle" :arrow="false" hover-class="none">
            <view class="value">免费/￥6.00</view>
          </u-cell-item>
          <u-cell-item title="订单留言" :title-style="titleStyle" hover-class="none">
            <view class="value">选填</view>
          </u-cell-item>
          <u-cell-item title="已选:" :title-style="titleStyle" hover-class="none">
            <view class="value u-text-left value-f">{{checklength}}件</view>
          </u-cell-item>
          <u-cell-item title="总价" :title-style="titleStyle" :arrow="false" hover-class="none">
            <view class="value u-text-left value-f">196.00</view>
          </u-cell-item>
        </u-cell-group>
      </view>
      <view class="s-btn s-btn--primary s-size-default" @click="confirmPay">确认支付</view>
    </u-popup>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        Data:[],
        Value:false,
        radioisShow:false,
        checklength:0,//已选商品数量
        checkboxList:[],
        deleteShow:false,
        confirmPayShow:false,
        titleStyle:{color:'#333'}
      }
    },
    onLoad(options) {
      let arr = [];
      for (let i = 1; i < 15; i++) {
        arr.push({
          "Id": i,
          "checked": false,
        });
      }
      this.Data = arr
    },
    methods: {
      OrderInfo(){
        uni.navigateTo({
          url: '/pages/Index/OrderInfo/OrderInfo'
        });
      },
      manage(){
        this.radioisShow = !this.radioisShow
      },
      // 选中任一checkbox时，由checkbox-group触发
      checkboxGroupChange(e) {
        console.log(e);
        //过滤掉勾选 全部 时为空的值
        var r = e.filter(function (s) {
           return s;
        })
        console.log(r);
        this.checklength = r.length
        this.checkboxList = r 
      },
      confirmDelete(){
        console.log('删除商品');
      },
      confirmPay(){
        console.log('确认支付');
      },
    }
  }
</script>

<style lang="scss" scoped>
  .img {
    width: 100%;
    height: 100%;
  }
  .content {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: fixed;
    bottom: 50px;
      }
    .list{
      background-color: #fff;
      margin-top: 24rpx;
      border-radius: 28rpx;
      .list-item{
        display: flex;
        font-size: 32rpx;
        position: relative;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        cursor: pointer;
        padding: 32rpx;
        .list-item__container{
          position: relative;
          display: flex;
          flex-direction: row;
          flex: 1;
          overflow: hidden;
          .list-item__radio{
            display: flex;
            flex-direction: row;
            align-items: center;
            margin-right: 8rpx;
          }
          .list-item__header {
            display: flex;
            flex-direction: row;
            align-items: center;
            .list-item__icon{
              margin-right: 18rpx;
              flex-direction: row;
              justify-content: center;
              align-items: center;
              .list-item__icon-img{
                  display: block;
                  height: 128rpx;
                  width: 128rpx;
                  margin-right: 20rpx;
              }
            }
          }
          .list-item__content{
            display: flex;
            padding-right: 16rpx;
            flex: 1;
            color: #3b4144;
            flex-direction: column;
            justify-content: space-between;
            overflow: hidden;
            .list-item__content-title{
              font-size: 28rpx;
              color: #3b4144;
              overflow: hidden;
            }
            .list-item__content-note{
              margin-top: 6rpx;
              font-size: 24rpx;
              overflow: hidden;
            }
            .list-item__content-price{
              margin-top: 6rpx;
              font-size: 24rpx;
              overflow: hidden;
              display: flex;
              align-items: center;
              .list-item__container-t{
                font-size: 24rpx;
              }
              .right{
                margin-left: auto;
              }
              .price{
                font-size: 32rpx;
              }
            }
          }
          .list-item__content--center{
            justify-content: center;
          }
          .list-item__extra{
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            align-items: center;
            .list-item__extra-text{
              color: #999;
              font-size: 24rpx;
            }
          }
        }
      }
    }
    .addressee{
      .addressee-title{
      }
      .address{
        font-size: 24rpx;
        margin-right: 24rpx;
      }
      .addressee-note{
        margin-top: 16rpx;
      }
    }
    .addressee:after,.addressee:before {
    	content: '';
    	display: block;
    	width: initial;
    	height: 4rpx;
    	background: -webkit-repeating-linear-gradient(135deg, #ff6c6c 0, #ff6c6c 20%, transparent 0, transparent 25%, #1989fa 0, #1989fa 45%, transparent 0, transparent 50%);
    	background: repeating-linear-gradient(-45deg, #ff6c6c 0, #ff6c6c 15%, transparent 0, transparent 25%, #1989fa 0, #1989fa 40%, transparent 0, transparent 50%);
    	background-size: 80px;
    	border: none;
    	-webkit-transform: initial;
    	transform: initial;
    }
    .value{
      color: #3b4144;
    }

  .total-price{
    width: 100%;
    height: 100rpx;
    position: fixed;
    bottom: 100rpx;
    z-index: 99;
    background-color: #fff;
    padding: 32rpx;
    text{
    }
  }
  .select{
    bottom: 200rpx;
    border-bottom:2rpx solid #e4e7ed;
    box-shadow: 0px -4px 12px 2px rgba(0, 0, 0, 0.12)
  }
  .box-shadow{
    box-shadow: 0px -4px 12px 2px rgba(0, 0, 0, 0.12)
  }
  .manage-btn{
    width: 100%;
    position: fixed;
    z-index: 99;
    border-bottom:2rpx solid #e4e7ed;
    background-color: #fff;
    padding: 32rpx;
  }
  .delete-btn_icon{
    font-size: 44rpx;
  }
  .value-f{
  }
</style>